<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp" %>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no">
    <meta name="format-detection" content="telephone=no">
    <title>我的停车券</title>
    <link rel="stylesheet" href="${ctx}/static/plug/frozenui-1.3.0/css/frozen.css" media="all">
    <style type="text/css">
        .content {
            padding-left: 20px;
            padding-right: 20px;
            margin-top: 20px;
        }

        .div-content {
            width: 100%;
            height: 80px;
            margin-top: 10px;
            padding-bottom: 5px;
            padding-top: 10px;
            background-color: #f39800;
            color: white;
            border-radius: 3px;
        }
        .error{
            padding-left: 20px;
            color:red;
            font-size: 10px
        }
        .genss{
        	color: #0081bc;
        	font-size: 20px;
        }
    </style>
</head>
<body>


<section class="ui-container">
    <div class="ui-flex  ui-flex-ver ui-flex-pack-center content" id="moneyDetailDiv">

        <div style="padding-top: 30px;" align="center">
        </div>

        <div class="div-content">
            <p class="ui-txt-white" style="font-size: 15px;" align="center">仅限${parkingPlaceName}</p>
            <ul class="ui-row-flex">
                <li class="ui-col">
                    <div class=""
                         style="padding-top: 0px; padding-bottom: 10px; padding-left: 10px; width: 100%">
                        <h2 style="font-size: 25px;">
                        <c:if test="${userCoupon.couponMoneyType == 1}">
                        ￥<fmt:formatNumber type="number" value="${userCoupon.money/10 }"   pattern="0.00" maxFractionDigits="2"/>
                        </c:if>
                         <c:if test="${userCoupon.couponMoneyType == 2}">
                       	免费停车券
                        </c:if>
                        </h2>
                    </div>
                </li>
                <li class="ui-col ui-col-3" style="padding-right: 15px" align="right">
                    <h1 class="ui-txt-white" style="font-size: 12px;padding-top:15px;" align="right"><fmt:formatDate value="${userCoupon.validDate}" pattern="yyyy-MM-dd HH:mm:ss"/>之前有效</h1>
                </li>
            </ul>
        </div>
        <div>
            <p class="error" id="showMsgP"></p>
        </div>

        <div style="padding-top: 30px;" align="center" class="genss">
        <c:if test="${subscribe == 1}">
            <p align="center">获取成功</p>
        </c:if>
        <c:if test="${subscribe == 0}">
            <p align="center">长按识别二维码并关注公众号即获得停车券</p>
            <img alt="" src="${ctx}/static/image/hbk.jpg" style="width: 50%; margin: 20px 25%;">
        </c:if>
        </div>

    </div>
</section>

</body>
<script src="${ctx}/static/plug/frozenui-1.3.0/lib/zepto.min.js"></script>
<script src="${ctx}/static/plug/frozenui-1.3.0/js/frozen.js"></script>
<script>

    var paramObj = {
        "generateCouponParams": "${generateCouponParams}",
        "myCouponsParams" : "${myCouponsParams}",
        "subscribe" : "${subscribe}"
    };

    $(function () {
    	var subscribe=paramObj.subscribe;
        console.log(subscribe);
        if(subscribe == 1){
//        	var hrefUrl="${action}?params=" + paramObj.myCouponsParams;
//            history.replaceState('a', null, 'do?params=' + paramObj.myCouponsParams);
//            window.location.href=hrefUrl;
        }
    });


</script>
</html>
